<!DOCTYPE html>
<html lang="zh-cn" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
<title th:text="|#{customer.systemTitle}-图灵谷-全局配置-全局配置|">图灵谷</title>
<div th:replace="fragments/head_admin">head</div>
</head>
<body>
	<div class="layui-layout layui-layout-admin">
		<div th:replace="fragments/nav_admin">导航栏</div>
		<div th:replace="fragments/menu_admin::menu(parent=gconfig,child=attr)">菜单栏</div>
		<div class="layui-body">
			<div class="layui-main">
				<!--/***** 面包屑 *****/-->
				<div class="layui-elem-quote" style="margin-top: 10px;">
					<span class="layui-breadcrumb"> <a><cite>全局配置</cite></a> <a th:href="@{/admin/m/base/attr/list.gsp}">文章属性</a> <a><cite>列表</cite></a>
					</span>
				</div>
				<form th:action="@{/admin/m/base/attr/edit.gsp}" th:object="${result}" class="layui-form" id="editForm" role="form" action="#" method="post">
					<fieldset class="layui-elem-field layui-field-title">
						<legend>新增文章属性</legend>
					</fieldset>
					<input th:field="*{id}" type="text" hidden="true" />
					<div class="layui-form-item">
						<label class="layui-form-label">属性名称：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<input type="text" name="attName" th:field="*{attName}" placeholder="请输入属性名称" lay-verify="attName" required autocomplete="off" class="layui-input" autofocus="autofocus" maxlength="21">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">属性代码：<span style="color: red">*</span></label>
						<div class="layui-input-block">
							<input type="text" name="codeNum" th:field="*{codeNum}" placeholder="请输入属性代码" lay-verify="codeNum" required autocomplete="off" class="layui-input" autofocus="autofocus" maxlength="21">
						</div>
					</div>
					<div class="layui-form-item">
						<div class="layui-input-block">
							<button class="layui-btn" lay-submit="" lay-filter="submit1">立即提交</button>
							<button type="reset" class="layui-btn layui-btn-primary">重置</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<div th:replace="fragments/footer_admin">底部</div>
	</div>
</body>
<div th:replace="fragments/import_js_admin">引入js</div>
</html>
<script th:inline="javascript">
    /*<![CDATA[*/
    var form = layui.form();
    //自定义验证规则
    form.verify({
        attName : function(value) {
            if (value.length < 2) {
                return '属性名称至少得2个字哦！';
            } else if (value.length > 20) {
                return '属性名称不能太长哦，最长20个字！';
            }
        },
        codeNum : function(value) {
            if (value.length < 2) {
                return '属性代码至少得2个字哦！';
            } else if (value.length > 20) {
                return '属性代码不能太长哦，最长20个字！';
            }
        }
    });
    //监听提交
    form.on('submit(submit1)', function(data) {
    });
    /*]]>*/
</script>